<template>
  <div :class="$style.container" class="kxz-home">
    <home-zj v-if="cuGroup === '质检组'"></home-zj>
    <template v-if="cuGroup !== '质检组'">
      <home-adminer v-if="cuuserType !== 3"></home-adminer>
      <home-user v-else></home-user>
    </template>
  </div>
</template>

<script>
import HomeAdminer from './components/adminer.vue'
import HomeUser from './components/user.vue'
import HomeZj from './components/zj.vue'

export default {
  name: 'home',
  computed: {
    cuuserType() {
      return this.$store.getters.getUserInfo.power
    },
    cuGroup(){
      return this.$store.getters.getUserInfo.userGroup
    }
  },
  components: {
    HomeAdminer,
    HomeUser,
    HomeZj
  },
  activated() {
    this.customStyle()
  },
  mounted() {
    this.customStyle()
  },
  methods:{
    customStyle() {
      this.$emit('onCustomStyle', {
        border: 'none',
        overflowY: 'auto',
        background: '#f5f8fb'
      })
    },
  }
}
</script>

<style lang="scss" module>
.container {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding-top: 22px;
}
</style>

<style lang="scss">
.kxz-home {
  $bdColor: #bac2cb;
  $color: #444;
  $dftColor: #7b8897;
  .container {
    position: relative;
    background: #fff;
    margin-bottom: 20px;
  }
  .icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    transform: translateY(8px);
    margin-right: 9px;
  }
  table {
    width: 100%;
    border-top: 1px solid $bdColor;
    border-left: 1px solid $bdColor;
    table-layout: fixed;
    td {
      box-sizing: border-box;
      border-right: 1px solid $bdColor;
      border-bottom: 1px solid $bdColor;
      text-align: center;
      font-size: 14px;
      color: $dftColor;
      height: 60px;
      &:first-child {
        color: $color;
      }
    }
    th {
      border-right: 1px solid $bdColor;
      border-bottom: 1px solid $bdColor;
      font-size: 16px;
      color: $color;
      line-height: 70px; // font-weight: normal;
    }
  }
  .title {
    line-height: 35px;
    padding: 25px;
    border: 1px solid $bdColor;
    border-bottom: none;
    color: $color;
    font-size: 18px;
  }
  .emptyTip {
    position: absolute;
    top: 92px;
    right: 1px;
    bottom: 1px;
    left: 251px;
    z-index: 1999;
    background-color: #fff;
    color: $color;
    font-size: 22px;
    font-weight: 600;
    span {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
  }
}
</style>
